package com.trt.beibei.core.configuration;

import com.trt.beibei.core.hack.AutoPrefixUrlMapping;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @version 1.0
 * @author: trt
 * @description: AutoPrefixUrlMapping不能通过@Component直接注入，需要使用Configuration注入ioc容器
 * @create: 2021-08-08 12:35
 */
@Component
public class AutoPrefixConfiguration implements WebMvcRegistrations {

    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new AutoPrefixUrlMapping();
    }
}